home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / question.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  1KB  |  48 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /*  question.c  */
  21.  
  22. #include <externs.h>
  23.  
  24.  
  25. int AVL_QUESTION(char *s)
  26. {
  27.     AVL_WIN_PTR m;
  28.     int n, j, ch;
  29.     short att; 
  30.     att = _settextcursor(0x0007);
  31.     n = (80 - (j = strlen(s))) / 2;
  32.     m = AVL_MAKE_WINDOW("",20,n,22,n+j+2,avl_que_bk_color,avl_que_color);
  33.     _settextposition(1,1);
  34.     _outtext(s);
  35.     _settextposition(1,j+1);
  36.     ch = toupper(getch());
  37.     if (ch == 0) ch = getch();
  38.     while (!(ch == 'Y' || ch == 'N')) {
  39.         AVL_ERROR("You must enter either Y or N");
  40.         _settextposition(1,j+1);
  41.         ch = toupper(getch());
  42.         if (ch == 0) ch = getch();
  43.         }
  44.     AVL_DEL_WINDOW(m);
  45.     _settextcursor(att);
  46.     return ch;
  47. }
  48.